<template>
    <span>{{dayTime}}<br/>{{clockTime}}</span>
</template>
<script>
    export default {
        name: 'TimeLabel',
        props: {
            pData: {
                type: String,
                default: ''
            }
        },
        data () {
            return {
                dayTime:'',
                clockTime:'',
            }
        },
        mounted(){
            this.init();
        },
        methods:{
            init(){
               var c = this.pData.split(" ");
               if(c&&c.length>0){
                   this.$set(this,'dayTime',c[0]||"");
                   this.$set(this,'clockTime',c[1]||"");
               }
            },
        },
        watch:{
            pData(value){
                this.init();
            }
        }
    }
</script>
